package com.itheima.leadnews.search.controller;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.search.dto.ApAssociateWordDto;
import com.itheima.leadnews.search.service.ApUserSearchService;
import com.itheima.leadnews.search.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController
@RequestMapping("/api/v1/associate")
public class AssociateController {

    @Autowired
    private SearchService searchService;

    @PostMapping("/search")
    public ResponseResult associateSearch(@RequestBody ApAssociateWordDto dto) throws IOException {
        //1.接收参数
        //2.调用service
        //3.响应数据
        return searchService.associateSearch(dto);

    }
}
